
   function check()
   {
	var txt="";
  var username1=document.form.username.value;
 var password1=document.form.password.value;
 var regMobile = /^(13[0-9]|14(5|7)|15(0|1|2|3|5|6|7|8|9)|18[0-9])\d{8}$/;
 var mflag = regMobile.test(document.form.phone.value);
  var len = /^(?=.*\d.*)(?=.*[a-zA-Z].*).{1,8}$/;
     if(username1=="")
     {
      txt+="Please enter your user name \n";
    }
     else  if(!(('0'<=username1&&'9'>=username1)||('a'<=username1&&'z'>=username1)||('A'<=username1&&'Z'>=username1)||username1=="_"))
           {
              txt="User name is not standard \n"
           }
     if(password1=="")
     {
      txt+="Please enter the password \n";
    }
     else if(!(('0'<=password1&&'9'>=password1)||('a'<=password1&&'z'>=password1)||('A'<=password1&&'Z'>=password1)||password1=="_"))
       {
           txt+="The password is not standard\n";
       }
  
       else if(password1.length>8)
       {
      	txt+="The password you entered is greater than 8 digits\n";
       }
    else
    {
       if(!len.test(password1))
       {
        txt+="Password strength does not conform to, please enter again \n";
       }
    }
 
     if(password1!=document.form.password1.value)
     {
      txt+="Two input password is not consistent  \n";
     }
     if(document.form.phone.value=="")
     {
      txt+="Please enter the phone number\n";
    }
     else if(document.form.phone.value.length!=11)
      {
      txt+="Mobile phone number length is not standard \n";
      }
     else if(!mflag)
      {
        txt+="The format of the mobile phone number is not correct \n";
      }
    
     if(document.form.email.value=="")
     {
      txt+="Please enter the email address\n";
    }
    else
    {
      with(document.form.email)
      {
       apos=value.indexOf("@");
       dotpos=value.lastIndexOf(".");
       if(apos<1||dotpos-apos<2)
       {
         txt+="Email address format is not correct \n";
       }
      }
    }
     if(txt=="")
     {
      return true;
     }
     else
     {
      alert(txt);
      location.href="login.html";
      return false;
     }
}

